#include "allowance_type_detail_struct_csv.hpp"
#include "type_conversion.hpp"
//#include <boost/lexical_cast.hpp>

//using boost::lexical_cast;
//using boost::bad_lexical_cast;

allowance_type_detail_struct_csv::allowance_type_detail_struct_csv(std::vector<std::string> const& v)
{
		
	   switch(v.size()-1)
 	   {
		case ALLOWANCE_LIMIT: 
			set_allowance_limit(type_conversion<float>::to_number(v[ALLOWANCE_LIMIT]));
		case NAME: 
			set_name(v[NAME]);
		case CHILD_ID:
			set_child_id(type_conversion<int>::to_number(v[CHILD_ID]));
		case PARENT_ID:
			set_parent_id(type_conversion<int>::to_number(v[PARENT_ID]));				
			break;
		default: break;
	   }
		
		std::cout << "[allowance_type_detail_struct_csv.allowance_type_detail_struct_csv] " <<*this << std::endl;
}